<cfif isdefined('form.site_owner')>
	 <cfinvoke component="cfcs.common.dbqueries" method="updatedata" tablename="core_settings" returnvariable="nothing" />
	 <cfinvoke component="cfcs.common.settings" method="writesettings" returnvariable="outputmsg" /> 
     <div id="messages">#request.lang.settings.title#</div>
</cfif>

<cfinvoke component="cfcs.common.settings" method="getsettings" returnvariable="qsettings" />
<cfinvoke component="cfcs.common.settings" method="getcomponents" returnvariable="qcomps" />
<cfinvoke component="cfcs.common.settings" method="getthemes" returnvariable="qthemes" />
<cfinvoke component="cfcs.common.settings" method="getpages" returnvariable="qpages" />
<cfinvoke component="cfcs.common.settings" method="getlayouts" theme="#request.site_theme#" returnvariable="qlayouts" />
<cfoutput query="qsettings">
<form method="post" action="index.cfm?c=settings&a=settings" name="settingsform">
<table width="700" border="0" cellspacing="0" cellpadding="6">
  <tr>
  	<td id="columnheaders" colspan="2">#request.lang.settings.subtitle1#</td>
  </tr>
  <tr>
    <td width="200">#request.lang.settings.label1#</td>
    <td><input name="site_owner" type="text" id="site_owner" size="45" value="#site_owner#"></td>
  </tr>
  <tr>
    <td>#request.lang.settings.label2#</td>
    <td><input name="site_email" type="text" id="site_email" size="45" value="#site_email#"></td>
  </tr>
  <tr>
    <td>#request.lang.settings.label3#</td>
    <td><select name="site_startup" id="site_startup">
      <option value="0" <cfif site_startup IS 0>selected="selected"</cfif>>Load a Page</option>
      <option value="1" <cfif site_startup IS 1>selected="selected"</cfif>>Load a Component</option>
    </select>
    </td>
  </tr>
  <tr>
    <td>#request.lang.settings.label4#</td>
    <td>
    <cfif qcomps.recordcount GT 0>
    <select name="site_component" id="site_component">
      <cfloop query="qcomps">
      <option value="#qcomps.name#" <cfif qsettings.site_component IS qcomps.name>selected="selected"</cfif>>#qcomps.name#</option>
      </cfloop>
    </select>
    <cfelse>
    <div id="messages_error">#request.lang.settings.missingcomponentsmsg#</div>
    </cfif>
    </td>
  </tr>
  <tr>
    <td>#request.lang.settings.label5#</td>
    <td>
    <cfif qpages.recordcount GT 0>
    <select name="site_startpage" id="site_startpage">
      <cfloop query="qpages">
      <option value="#qpages.name#" <cfif qsettings.site_startpage IS qpages.name>selected="selected"</cfif>>#qpages.name#</option>
      </cfloop>
    </select>
    <cfelse>
    <div id="messages_error">#request.lang.settings.missingpagesmsg#</div>
    </cfif>    
    </td>
  </tr>
  <tr>
    <td>#request.lang.settings.label6#</td>
    <td>
    <cfif qthemes.recordcount GT 0>
    <select name="site_theme" id="site_theme">
      <cfloop query="qthemes">
      <option value="#qthemes.name#" <cfif qsettings.site_theme IS qthemes.name>selected="selected"</cfif>>#qthemes.name#</option>
      </cfloop>
    </select>
    <cfelse>
    <div id="messages_error">#request.lang.settings.missingtemplatesmsg#</div>
    </cfif>    
    </td>
  </tr>
  <tr>
    <td>#request.lang.settings.label7#</td>
    <td>
    <cfif qthemes.recordcount GT 0>
    <select name="site_defaultlayout" id="site_defaultlayout">
      <cfloop query="qlayouts">
      <option value="#qlayouts.name#" <cfif qsettings.site_defaultlayout IS qlayouts.name>selected="selected"</cfif>>#qlayouts.name#</option>
      </cfloop>
    </select>
    <cfelse>
    <div id="messages_error">#request.lang.settings.missinglayoutsmsg#</div>
    </cfif>    
    </td>
  </tr>
  <tr>
    <td colspan="2" id="columnheaders">#request.lang.settings.subtitle2#</td>
  </tr>
  <tr>
    <td>#request.lang.settings.label8#</td>
    <td><input name="meta_title" type="text" id="meta_title" size="45" value="#meta_title#" /></td>
  </tr>
  <tr>
    <td>#request.lang.settings.label9#</td>
    <td><textarea name="meta_description" id="meta_description" style="width: 250px; height: 50px;">#meta_description#</textarea></td>
  </tr>
  <tr>
    <td>#request.lang.settings.label10#</td>
    <td><textarea name="meta_keywords" id="meta_keywords" style="width: 250px; height: 50px;">#meta_keywords#</textarea></td>
  </tr>
  <tr>
    <td>#request.lang.settings.label11#</td>
    <td><input name="meta_abstract" type="text" id="mega_abstract" size="45" value="#meta_abstract#" /></td>
  </tr>
  <tr>
    <td>#request.lang.settings.label12#</td>
    <td><input name="meta_msnbot" type="text" id="meta_msnbot" size="45" value="#meta_msnbot#" /></td>
  </tr>
  <tr>
    <td>#request.lang.settings.label13#</td>
    <td><input name="meta_googlebot" type="text" id="meta_googlebot" size="45" value="#meta_googlebot#" /></td>
  </tr>
  <tr>
    <td>#request.lang.settings.label14#</td>
    <td><input name="meta_robots" type="text" id="meta_robots" size="45" value="#meta_robots#" /></td>
  </tr>
  <tr>
    <td>#request.lang.settings.label15#</td>
    <td><input name="meta_image" type="text" id="meta_image" size="45" value="#meta_image#" /></td>
  </tr>
  <tr>
    <td colspan="2"><input type="submit" value="Save Settings" id="abutton" name="submitbutton"></td>
  </tr>
</table>
</form>
</cfoutput>